﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using BusinessLayer;

namespace RoleBasedSecurity.Generics
{
    public class GPrincipal : IPrincipal
    {
        private GIdentity _Identity;
        private string[] _roles;

        public GPrincipal(GIdentity Identity, string[] roles)
        {
            _Identity = Identity;
            _roles = roles;
        }

        public IIdentity Identity
        {
            get { return _Identity; }
        }

        public bool IsInRole(string role)
        {
            return Members.IsInRole(role);
        }
    }
}